If a cast is to be used on any complex expression, the type of cast that may be applied is severely restricted. As explained in MISRA C 2004,
section 6.10, conversions on complex expressions are often a source of confusion and it is therefore wise to be cautious. In order to comply with
these rules, it may be necessary to use a temporary variable and introduce an extra statement.
Noncompliant code example
... (float32_t)(f64a + f64b)
... (float64_t)(f32a + f32b) // Noncompliant
... (float64_t)f32a
... (float64_t)(s32a / s32b) // Noncompliant
... (float64_t)(s32a > s32b) // Noncompliant
... (float64_t)s32a / (float32_t)s32b
... (uint32_t)(u16a + u16b) // Noncompliant
... (uint32_t)u16a + u16b
... (uint32_t)u16a + (uint32_t)u16b
... (int16_t)(s32a - 12345)
... (uint8_t)(u16a * u16b)
... (uint16_t)(u8a * u8b) // Noncompliant
... (int16_t)(s32a * s32b)
... (int32_t)(s16a * s16b) // Noncompliant
... (uint16_t)(f64a + f64b) // Noncompliant
... (float32_t)(u16a + u16b) // Noncompliant
... (float64_t)foo1(u16a + u16b)
... (int32_t)buf16a[u16a + u16b]